package com.qu.ListControl.materialdesign.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.qu.ListControl.List.base.BaseRecyclerAdapter;
import com.qu.ListControl.R;
import com.qu.ListControl.materialdesign.bean.Test1;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by pc on 2017/10/11.
 */

public class Test1Adapter extends BaseRecyclerAdapter<Test1> {
    public Test1Adapter(Context context, int mode) {
        super(context, mode);
    }

    @Override
    protected RecyclerView.ViewHolder onCreateDefaultViewHolder(ViewGroup parent, int type) {
        return new ViewHolder(mInflater.inflate(R.layout.test1_recycler_item,parent,false));
    }

    @Override
    protected void onBindDefaultViewHolder(RecyclerView.ViewHolder holder, Test1 item, int position) {
        ViewHolder viewHolder = (ViewHolder) holder;
        viewHolder.textView.setText(item.getText());
    }


    class ViewHolder extends RecyclerView.ViewHolder{
        @BindView(R.id.tv_test1)
        TextView textView;
        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
